<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./别踩白块.css">
  <title>白块hh</title>
</head>

<body>
  <!-- 游戏容器 -->
  <div class="gameContainer">
    <p id="score">0</p>
    <div id="main"></div>
    <!-- 开始 -->
    <div class="start" id="start">
      <p>请拍晓丹儿</p>
      <span id="go">开始游戏</span>
    </div>
    <!-- 重新开始 -->
    <div class="end" id="end" style="display: none;">
      <p>游戏结束</p>
      <h3 id="res">得分:0</h3>
      <span id="again">重新开始</span>
    </div>
  </div>

  <script src="./Block.js"></script>
  <script>
    const start = document.getElementById('start');
    const end = document.getElementById('end');
    const main = document.getElementById('main');
    const go = document.getElementById('go');
    const again = document.getElementById('again');

    let game = new Block(main);
    game.click();
    go.onclick = function () {
      start.style.display = 'none';
      game.start();
    }
    again.onclick = function () {
      end.style.display = 'none';
      game.again();
    }
  </script>

</body>

</html>